package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


/**
 * @Author: YangYu
 * @ClassName: CommonService
 * @Date: Created in 14:26 2020/12/23
 * @Description: 通用服务
 */
@Service
@Slf4j
public class CommonService extends BaseService {

    /**
     * @Author YangYu
     * @Description 隶属单位不分页列表
     * @Date Created in 13:54 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity subjectionBusinessList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","subjectionBusinessList","common");
    }

    /**
     * @Author YangYu
     * @Description 隶属单位分页列表
     * @Date Created in 16:57 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity subjectionBusinessPagList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","subjectionBusinessPagList","common");
    }
    /**
     * @Author YangYu
     * @Description 行政区划列表
     * @Date Created in 13:43 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity regionList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","regionList","common");
    }


    /**
     * @Author YangYu
     * @Description 行政区划分页列表
     * @Date Created in 14:31 2021/1/7
     * @Param [jsonParam]
     */

    public RespEntity regionPagList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","regionPagList","common");
    }

    /**
     * @Author YangYu
     * @Description 获取省、市、区的下拉列表
     * @Date Created in 14:31 2021/1/7
     * @Param [jsonParam]
     */

    public RespEntity getRegionDownList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","getRegionDownList","common");
    }

    /**
     * @Author YangYu
     * @Description 消防机构列表
     * @Date Created in 14:37 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity organizationFireList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","organizationFireList","common");
    }

    /**
     * @Author YangYu
     * @Description 消防设施列表
     * @Date Created in 14:48 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity fireControlFacilitiesList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","fireControlFacilitiesList","common");
    }

    /**
     * @Author YangYu
     * @Description 字典列表
     * @Date Created in 9:58 2020/12/24
     * @Param [jsonParam]
     */

    public RespEntity dictList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","dictList","common");
    }

    /**
     * @Author YangYu
     * @Description 设备类型列表
     * @Date Created in 10:04 2020/12/28
     * @Param [jsonParam]
     */

    public RespEntity deviceTypeList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam, "basisInfo", "deviceTypeList", "common");

    }
}
